const Login = () => import(/* webpackChunkName: "index" */ '../pages/login')
const Layout = () => import(/* webpackChunkName: "index" */ '../pages/layout')
const Home = () => import(/* webpackChunkName: "index" */ '../pages/home')
const Article = () => import(/* webpackChunkName: "index" */ '../pages/article')
const Publish = () => import(/* webpackChunkName: "index" */ '../pages/publish')
// import Page404 from '@/views/test/page404'

const routes = [
  {
    path: '/index',
    component: Layout,
    meta: {
      title: '首页',
      needLogin: true
    },
    children: [{
      path: '/index/home',
      component: Home,
      meta: {
        title: '首页',
        needLogin: true
      },
    }, {
      path: '/index/article',
      component: Article,
      meta: {
        title: '文章页',
        needLogin: true
      },
    },
    {
      path: '/index/publish',
      component: Publish,
      meta: {
        title: '发布页',
        needLogin: true
      },
    },],
  },
  {
    path: '/login',
    component: Login,
    meta: {
      title: '登录',
      needLogin: false
    }
  },
  {
    path: '/',
    redirect: '/login',
  },
  {
    path: '/index/',
    redirect: '/index/home',
  }
  // {
  //   path: '*',
  //   element: <Page404 />,
  // },
]

export {
  routes,
}
